<?xml version="1.0" encoding="UTF-8" ?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	template="/WEB-INF/templates/general.xhtml">

	<ui:define name="title">
		<h:outputText value="Welcome!" />
	</ui:define>
	<ui:define name="header">
		<h:outputText value="User Statistics" />
	</ui:define>

	<ui:define name="content">
		<h:form id="loginForm">
			<p:dataTable var="userEntity" value="#{userBean.users}">
				<p:column headerText="Firstname">
					<h:outputText value="#{userEntity.firstName}" />
				</p:column>
				<p:column headerText="Lastname">
					<h:outputText value="#{userEntity.lastName}" />
				</p:column>
				<p:column headerText="Username">
					<h:outputText value="#{userEntity.username}" />
				</p:column>

			</p:dataTable>
			<p:commandButton id="submitButton" actionListener="#{userBean.getAllUsers}" update="loginForm" icon="ui-icon-plus" value="Update" />
		</h:form>
	</ui:define>

</ui:composition>